home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Free Software Collection 6 / FM Towns Free Software Collection 6.iso / ms_dos / cd_lib / src / cdr_cont.c next >
Encoding:
C/C++ Source or Header  |  1993-07-08  |  874 b   |  41 lines

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <dos.h>
  4. #include "define.h"
  5.  
  6. #ifdef DEBUG
  7. main()
  8. {
  9.     printf("return is %d\n", cdr_continue(0));
  10. }
  11. #endif
  12.  
  13. /* 音楽演奏一時停止解除 */
  14. /*
  15.  * decice_no:   device number (Towns CD-ROM -> 0)
  16.  * return: 0 -> 正常終了, DEVNPAUSE -> 停止状態ではない, それ以外 -> エラー
  17.  */
  18. int cdr_continue(int device_no)
  19. {
  20.     union REGS reg;
  21.     
  22.     reg.h.ah = 0x56;
  23.     reg.h.al = (0xC0 | (u_char) device_no);
  24.     reg.x.cx = 0x0000;
  25.     
  26.     int86(0x93, ®, ®);
  27.     
  28.     if (reg.h.ah == 0) {
  29.         return 0;
  30.     } else if (reg.h.ah == 0x23) {  /* not stopped */
  31.         return DEVNPAUSE;
  32.     } else if (reg.h.ah == 0x02) {  /* device number error */
  33.         return DEVERR;
  34.     } else if (reg.h.ah == 0x10) {  /* cd-da plaing */
  35.         return DEVPLY;          
  36.     } else {                        /* (reg.h.ah == 0x80) hard ware error */
  37.         return reg.x.cx;
  38.     }
  39. }
  40.  
  41.